package com.hsjk.szwj.module.train.mq.delayed;

import com.hsjk.szwj.framework.mq.core.listener.RedisDelayedQueueListener;
import com.hsjk.szwj.module.train.dal.dataobject.mq.OrderFailureTimeMQ;
import com.hsjk.szwj.module.train.mq.producer.OrderFailureTimeProducer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author chenjiawei
 * @desc 订单失效延迟监听
 * @Date 2023/11/22 22:47
 **/
@Component
@Slf4j
public class OrderFailureTimeListener implements RedisDelayedQueueListener<OrderFailureTimeMQ> {

    @Resource
    private OrderFailureTimeProducer producer;

    @Override
    public void invoke(OrderFailureTimeMQ orderFailureTimeMQ) {
        log.info("订单失效延迟监听,orderId:{}", orderFailureTimeMQ.getOrderId());
        producer.sendMessage(orderFailureTimeMQ);
    }
}
